package com.zrar.ak.gkpt.dao;

import com.zrar.ak.gkpt.model.bo.BusinessAccountBasicInfoBO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @InterfaceName: IBusinessAccountBasicInfoDao
 * @Description 台账基本信息Dao层
 * @Author liyang
 * @Time 2020/04/02
 */
@Repository("businessAccountBasicInfoDao")
public interface IBusinessAccountBasicInfoDao extends Mapper<BusinessAccountBasicInfoBO> {

    @Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_ACCOUNT_BASIC_INFO WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByAccountInfoUnitId(String unitId);

    @Update(" UPDATE BUSINESS_ACCOUNT_BASIC_INFO SET IS_DELETE='1' WHERE IS_DELETE='0' AND UNIT_ID = #{unitId}")
    void deleteAccountBasicInfoByUnitId(String unitId);


    Integer queryAccountBasicInfoShowNum(Map map);

    List<BusinessAccountBasicInfoBO> pagingQueryAccountBasicInfoList(Map map);
}
